package org.firebug.spring.boot.logback.controller;

import ch.qos.logback.classic.AsyncAppender;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/calc")
public class CalcController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @RequestMapping(value = "/abs", method = {RequestMethod.GET})
    public double abs(double a) {
        logger.trace("abs(a) = {}", Math.abs(a));
        logger.debug("abs(a) = {}", Math.abs(a));
        logger.info("abs(a) = {}",  Math.abs(a));
        logger.warn("abs(a) = {}",  Math.abs(a));
        logger.error("abs(a) = {}", Math.abs(a));
        return Math.abs(a);
    }
}
